<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>分类</title>
    <link rel="stylesheet" href="../layui-v2.6.8/layui/css/layui.css">
    <link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css">
    <script src="../layui-v2.6.8/layui/layui.js"></script>
    <script src="../jquery/jquery.min.js"></script>
    <script src="../bootstrap/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="css/bottom-cav.css">
    <style>
        
        .cen-nav{
            margin-left: 40px;
            float: left;
           
        }
        .top-nav{
            height: 60px;
            width: 1600px;
            background-color: #393D49;
        }
        a{text-decoration: none;}
        .pos{
            float: left;
            margin-top: 18px;
            margin-left: 150px;
            
        }
        .log-register{
            float: right;
            margin-right: 300px;
            margin-top: 18px;
            color: rgba(255,255,255,.7);
        }
        .log-register span a{
            color: rgba(255,255,255,.7);
            text-decoration: none;
        }
        .log-register span a:hover{
            color: white;
        }
        .center-content{
          
            
            width: 1250px;
            margin-left: 150px;
            
        }
        .top-seach{
            height: 80px;
            background-color: rgb(245, 245, 246);
        }
        .seach{
            width: 600px;
            margin-left: 150px;
            margin-top: 10px;
        }

        .rent-type{
            margin-left: 150px;
            height: 25px;
            margin-top: 15px;
            
        }
        .rent-type a{
            color: rgb(146, 146, 146);
        }
        .class-area span{
            margin-right: 15px;
        }
        .class-area span a{
            text-decoration: none;
            color: #101d37;
            
        }
        .class-area span a:hover{
            color: blue;
        }
        .class-area{
            width: 100%;
            height: 30px;
            margin-bottom: 5px;
        }   
        .house-sort-type div{
            border-right: 1px solid rgb(237, 237, 237);
            width: 85px;
            float: left;
            height: 53px;
            padding: 15px;
            margin-top: -18px;
        }
        #house-count{
            border: none;
            width: 300px;
            font-weight: bold;
            font-size: 18px;
            margin-left: 50px;
        }
        .house-data{
            margin-left: 150px;
            width: 1250px;
            margin-top: 20px;
        }
        .bottom-house-info-left{
            width: 900px;
     
            float: left;
            background-color: white;
        }
        .bottom-house-info-right{
            width: 250px;
            float: right;   
            background-color: white;
        }
        .bottom-house-info{
            margin-left: -20px;
            border: 1px solid red;
       
        }
        .house-info{
            float: left;
            margin-bottom: 20px;
            margin-left: 20px;
        }
        .house-info-right{
            
            float: left;
            margin-left: 30px;
           
        }
        .house-info-right div{
            margin-top: 15px;
            color: #849aae;
        }
        .house-info-right div span{
            background-color:rgba(83, 92, 102, 0.1) ;
            padding: 5px;
        }
        .house-info img{
            border-radius: 10px;
        }
        .Pagination{
            float: left;
            margin-top: 20px;
            margin-left: 300px;
        }
        #username-pic{
            margin-right: 300px;
       }
       #top-username{
            float: left;
            margin-top: 27px;
            
            font-weight: bold;
            font-size: 16px;
       }
       #top-exit{
            float: left;
            margin-top: 27px;
            margin-left: 10px;
            
            font-weight: bold;
            font-size: 16px;
       }
       
    </style>
</head>
<body style="background-color: #f2f2f2;position: absolute;margin: auto;top:0;left:0;right: 0;bottom: 0;">
    <div class="class-outer">
        <div class="top-nav">
            <div class="pos">
                <a href="search.html">
                    <span class="glyphicon glyphicon-map-marker" style="font-weight: bold;color: rgba(255,255,255,.7) ;">&nbsp;吴中区</span>
                </a>
            </div> 
            <div class = "cen-nav"> 
                  <ul class="layui-nav" style="font-weight:bolder;">
                    
                    <li class="layui-nav-item"><a href="frontpage.html">首页</a></li>
                    <li class="layui-nav-item"><a href="Classification.html?hire=0">合租</a></li>
                    <li class="layui-nav-item"><a href="Classification.html?hire=1">整租</a></li>
                    <li class="layui-nav-item layui-this"><a href="Classification.html">分类</a></li>
                    <li class="layui-nav-item"><a href="manager.html">经纪人登录</a></li>
                    <li class="layui-nav-item"><a href="javascript:void(0)" onclick="release()">发布房源</a></li>
                  </ul>
            </div>
            <div class="log-register" id="log-register" style="display: none;">
                <span><a href="logpage.html">登录</a></span>
                <span>|</span>
                <span><a href="registerpage.html">注册</a></span>
            </div>
            <div id="username-pic" style="float: right;display: none;">
                <img src="image/picwish.png" alt="" width="60px" height="60px" style="border-radius: 50px;float: left;">
                <div id = "top-username">
                    <a href="html/myself.html"  style="color: rgba(255,255,255,.7);" id="husername"><span>余春海</span></a>
                </div>
                <div id="top-exit"><a href="javascript:void(0)" onclick="top_exit()" style="color: rgba(255,255,255,.7);"><span>退出</span></a></div>
            </div>
        </div>
        <div class="top-seach">
            <div class="input-group seach">
                <input id="select-one" type="text" class="form-control" id="name" style="height: 50px;margin-top: 10px;" placeholder="输入小区、模块进行找房">
                <span class="input-group-btn">
                    <button onclick="selectTwo()" class="btn btn-default" style="width:60px;height: 50px;background-color: white;border-top-right-radius: 6px;border-bottom-right-radius: 6px;margin-top: 10px;" type="button">
                        <div class="glyphicon glyphicon-search">
                        </div>
                    </button>
                    <button class="btn btn-default" style="margin-left: 20px; width:80px;height: 50px;background-color: white;border-radius: 6px;margin-top: 10px;" type="button">
                        <div class="glyphicon glyphicon-map-marker" style="float: left;">
                            
                        </div>
                        <div>地图</div>
                    </button>
                </span>
            </div>
            
        </div>
        <div class="rent-type">
            <a>吴中区</a>
            >
            <a>整租</a>
        </div>
        <div class="center-content" style="background-color: rgb(252, 250, 250);">
            <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                <ul class="layui-tab-title">
                  <li class="layui-this">按区域找房</li>
                  <li>按地铁找房</li>
                </ul>
                <div class="layui-tab-content" style="margin-left: 20px;">
                  <div class="layui-tab-item layui-show">
                        <div class="class-area">
                            <div style="font-weight:bold;font-size:16px;margin-right: 20px;width: 60px;float: left;margin-top: -2px;">区域:</div>
                            <span><a href="javascript:change1(0)">不限</a></span>
                            <span><a href="javascript:change1(1)">吴中</a></span>
                            <span><a href="javascript:change1(2)">吴江</a></span>
                            <span><a href="javascript:change1(3)">园区</a></span>
                            <span><a href="javascript:change1(4)">太仓</a></span>
                            <span><a href="javascript:change1(5)">姑苏</a></span>
                            <span><a href="javascript:change1(6)">常熟</a></span>
                            <span><a href="javascript:change1(7)">平江</a></span>
                            <span><a href="javascript:change1(8)">张家港</a></span>
                            <span><a href="javascript:change1(9)">高新区</a></span>
                            <span><a href="javascript:change1(10)">沧浪</a></span>
                            <span><a href="javascript:change1(11)">相城</a></span>
                            <span><a href="javascript:change1(12)">昆山</a></span>
                            <span><a href="javascript:change1(13)">金阊</a></span>
                        </div>
                  </div>

                  <div class="layui-tab-item">
                        <div class="class-subway">
                            <div class="class-area">
                                <div style="font-weight:bold;font-size:16px;margin-right: 20px;width: 60px;float: left;margin-top: -2px;">地铁:</div>
                                <span><a href="javascript:change1(0)">不限</a></span>
                                <span><a href="javascript:change1(14)">1号线</a></span>
                                <span><a href="javascript:change1(15)">2号线</a></span>
                                <span><a href="javascript:change1(16)">4号线</a></span>
                                <span><a href="javascript:change1(17)">4号线支线</a></span>
                                <span><a href="javascript:change1(18)">3号线</a></span>
                            </div>
                        </div>
                  </div>
                  <hr>
                  <div class="class-area">
                    <div style="font-weight:bold;font-size:16px;margin-right: 20px;width: 60px;float: left;margin-top: -2px;">租金:</div>
                    <span style="float: left;"><a href="">不限</a></span>
                    <form class="layui-form" action="" style="float: left;margin-top: -8px;margin-bottom: 0px;margin-left: -80px;">
                        <div class="layui-form-item" pane="" style="margin-bottom: 0px;">
                        <div class="layui-input-block" style="float: left;">
                            <input id="house-price" type="checkbox" name="like1[write]" lay-skin="primary" title="1500以下">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="1500-2000">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="2000-3000">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="3000-4000">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="4000-5000">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="5000以下">
                        </div>
                        <div class="layui-inline" style="float: left;"> 
                            <div class="layui-input-inline" style="width: 100px;">
                            <input id="beforeone" type="text" name="price_min" placeholder="￥" autocomplete="off" class="layui-input" style="height: 30px;">
                            </div>
                            <div class="layui-form-mid">-</div>
                            <div class="layui-input-inline" style="width: 100px;">
                            <input id="afterone" type="text" name="price_max" placeholder="￥" autocomplete="off" class="layui-input"style="height: 30px;">
                            </div>
                            <div class="layui-btn-container" style="float: left;">
                                <button type="button" class="layui-btn layui-btn-normal" style="height: 30px;width:35px;padding-left: 2px;" onclick="priceone()">确定</button>
                            </div>
                        </div>
                        </div>
                    </form>
                  </div>
                  <div class="class-area">
                    <div style="font-weight:bold;font-size:16px;margin-right: 20px;width: 60px;float: left;margin-top: -2px;">类型:</div>
                    <span style="float: left;"><a href="">不限</a></span>
                    <form class="layui-form" action="" style="float: left;margin-top: -8px;margin-bottom: 0px;margin-left: -80px;">
                        <div class="layui-form-item" pane="" style="margin-bottom: 0px;">
                        <div class="layui-input-block" style="float: left;">
                            <input id="select-check" type="checkbox" name="like1[write]" lay-skin="primary" title="合租">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="整租">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="公寓">
                        </div>
                        </div>
                    </form>
                  </div>
                  <div class="class-area">
                    <div style="font-weight:bold;font-size:16px;margin-right: 20px;width: 60px;float: left;margin-top: -2px;">户型:</div>
                    <span style="float: left;"><a href="">不限</a></span>
                    <form class="layui-form" action="" style="float: left;margin-top: -8px;margin-bottom: 0px;margin-left: -80px;">
                        <div class="layui-form-item" pane="" style="margin-bottom: 0px;">
                        <div class="layui-input-block" style="float: left;">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="一室">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="二室">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="三室">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="三室以上">
                        </div>
                        </div>
                    </form>
                  </div>
                  <div class="class-area">
                    <div style="font-weight:bold;font-size:16px;margin-right: 20px;width: 60px;float: left;margin-top: -2px;">特色:</div>
                    <span style="float: left;"><a href="">不限</a></span>
                    <form class="layui-form" action="" style="float: left;margin-top: -8px;margin-bottom: 0px;margin-left: -80px;">
                        <div class="layui-form-item" pane="" style="margin-bottom: 0px;">
                        <div class="layui-input-block" style="float: left;">
                            <input id="house-characteristic" type="checkbox" name="like1[write]" lay-skin="primary" title="独卫">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="月付">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="近地铁">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="朝南">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="带阳台">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="精装修">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="家电齐全">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="阳光收费"><br>
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="精品房型">
                        </div>
                        </div>
                    </form>
                  </div><br>
                  <div class="class-area">
                    <div style="font-weight:bold;font-size:16px;margin-right: 20px;width: 60px;float: left;margin-top: -2px;">租期:</div>
                    <span style="float: left;"><a href="">不限</a></span>
                    <form class="layui-form" action="" style="float: left;margin-top: -8px;margin-bottom: 0px;margin-left: -80px;">
                        <div class="layui-form-item" pane="" style="margin-bottom: 0px;">
                        <div class="layui-input-block" style="float: left;">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="月租">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="年租">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="一个月起租">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="1-3个月">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="4-6个月">
                        </div>
                        </div>
                    </form>
                  </div>
                  <div class="class-area">
                    <div style="font-weight:bold;font-size:16px;margin-right: 20px;width: 60px;float: left;margin-top: -2px;">楼层:</div>
                    <span style="float: left;"><a href="">不限</a></span>
                    <form class="layui-form" action="" style="float: left;margin-top: -8px;margin-bottom: 0px;margin-left: -80px;">
                        <div class="layui-form-item" pane="" style="margin-bottom: 0px;">
                        <div class="layui-input-block" style="float: left;">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="低楼层">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="中楼层">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="高楼层">
                        </div>
                        </div>
                    </form>
                  </div>  
                  <div class="class-area">
                    <div style="font-weight:bold;font-size:16px;margin-right: 20px;width: 60px;float: left;margin-top: -2px;">电梯:</div>
                    <span style="float: left;"><a href="">不限</a></span>
                    <form class="layui-form" action="" style="float: left;margin-top: -8px;margin-bottom: 0px;margin-left: -80px;">
                        <div class="layui-form-item" pane="" style="margin-bottom: 0px;">
                        <div class="layui-input-block" style="float: left;">
                            <input id="if-lift" type="checkbox" name="like1[write]" lay-skin="primary" title="有电梯">
                            <input type="checkbox" name="like1[write]" lay-skin="primary" title="无电梯">
                        </div>
                        </div>
                    </form>
                  </div>
                  <hr>
                  <div style="margin-top:10px">
                    <div style="font-size:16px;width:60px;float:left;">已选:</div>
                    <div style="font-size:16px;border: 1px solid;width: 90px;float: left;"><a href="" ><span class="glyphicon glyphicon-trash"></span>一键清空</a></div>
                  </div>
                  <br>
                  <hr>
                  <div class="house-sort-type">
                    <div class="sort" style="margin-left: -12px;">
                        排序:
                    </div>
                    <div class="comprehensive ">
                        <a href="">综合</a>
                    </div>
                    <div class="price layui-icon layui-icon-up">
                        <a href="">价格</a>
                    </div>
                    <div class="area-type layui-icon layui-icon-down">
                        <a href="">面积</a>
                    </div>
                    <div id="house-count">
                        已为您找到 <a href="">1719套</a>房源
                    </div>
                  </div>
                  <br>
                </div> 
            </div>
        </div>
        <div class="house-data">
           <!-- 详情 -->
            <div class="bottom-house-info-left" id ="housedatas">
            </div>
            
            <div class="bottom-house-info-right">
                <div id="house-recommend" class="bottom-house-info-right">
                    <div style="margin-left: 30px; height:10px;margin-bottom: 20px;margin-top: 10px;font-weight: bold;font-size: 18px;">推荐房源</div>

                </div>
            </div>
        </div>
        <br>   
        <div class="Pagination">
            <div id="layuipage"></div>
        </div>
        <div class="log_buttom">
            <div class="log-logo">
            </div>
            <div  class="log-buttom-icon">
                <div class="glyphicon glyphicon-film" style=" color: white;width:50px;height: 50px;font-size: 50px;margin-top: 40px;margin-left: 70px;"></div>
                <div style="margin-left: 65px;color: white;font-size: 15px;font-weight: bold;margin-top: 10px;">极速找房</div>
            </div>
            <div class="log-buttom-icon" >
                <i class="layui-icon layui-icon-service" style="font-size: 56px;color:white;margin-left:150px;display: block;margin-top: 30px;"></i>
                <div style="margin-left: 150px;color: white;font-size: 15px;font-weight: bold;margin-top: -5px;">在线客户</div>
            </div>
            <div class="log-buttom-icon" >
                <i class="layui-icon layui-icon-date" style="font-size: 56px;color:white;margin-left:150px;display: block;margin-top: 30px;"></i>
                <div style="margin-left: 150px;color: white;font-size: 15px;font-weight: bold;margin-top: -5px;">在线预约</div>
            </div>
            <div class="log-buttom-icon" >
                <i class="layui-icon layui-icon-find-fill" style="font-size: 56px;color:white;margin-left:150px;display: block;margin-top: 30px;"></i>
                <div style="margin-left: 150px;color: white;font-size: 15px;font-weight: bold;margin-top: -5px;">地图找房</div>
            </div>
            
        </div>
        <div class="buttom_nav">
            <div class="buttom_nav_center">
                <div class="recommend-area-rent">
                    <div class="title">
                        推荐区域租房
                    </div>
                    <div class="recommend-content">
                        <span class="">
                            <a href="">吴中</a>
                            <a href="">吴江</a>
                            <a href="">园区</a>
                            <a href="">太仓</a>
                            <a href="">姑苏区</a>
                            <a href="">常说</a>
                            <a href="">平江</a>
                            <a href="">张家港</a>
                            <a href="">高新区</a>
                            <a href="">沧浪</a>
                            <a href="">相城</a>
                            <a href="">昆山</a>
                            <a href="">金阊</a>
                            </span>
                    </div>
                </div>
                <div  style="border-top: 1px solid #8b8d92;margin-top: 80px;height: 15px;"></div>
                <div class="recommend-subway-rent">
                    <div class="title">
                        推荐地铁租房
                    </div>
                    <div class="recommend-content">
                        <span class="">
                            <a href="">1号线</a>
                            <a href="">2号线</a>
                            <a href="">3号线</a>
                            <a href="">4号线支线</a>
                            <a href="">4号线</a>
                            </span>
                    </div>
                </div>
                <div  style="border-top: 1px solid #8b8d92;margin-top: 40px;height: 15px;"></div>
                <div class="Recommend-type-rent">
                    <div class="title">
                        推荐类型租房
                    </div>
                    <div class="recommend-content">
                        <span>
                            <a href="">苏州合租</a>
                            <a href="">苏州整租</a>
                            <a href="">苏州公寓</a>
                            </span>
                    </div>
                </div>
                <div  style="border-top: 1px solid #8b8d92;margin-top: 40px;height: 15px;"></div>
                <div id="about-suleju">
                    <div class="title" style="float: left;width: 200px;height: 300px;">
                        <div style="width: 200px;">
                            关于苏乐居
                        </div>
                        <div class="recommend-content" style="width:100px;margin-top: 0px;font-weight: normal;">
                            <span>
                                <a href="" >伙伴登录</a>
                                <a href="" style="margin-top: 10px;display: block;">网站地图</a>
                                </span>
                        </div>
                    </div>
                    <div class="title" style="float: left;width: 200px;">
                        <div style="width: 200px;">
                            苏乐居合作公寓
                        </div>
                        <div class="recommend-content" style="width:140px;margin-top: 0px;font-weight: normal;">
                            <span>
                                <a href="" >青年汇</a>
                                <a href="" style="margin-top: 10px;display: block;">银桥公寓</a>
                                <a href="" style="margin-top: 10px;display: block;">爱家精品公寓</a>
                                </span>
                        </div>
                    </div>
                    <div class="title" style="float: left;width: 200px;">
                        <div style="width: 200px;">
                            意见回馈
                        </div>
                        <div class="recommend-content" style="width:100px;margin-top: 0px;font-weight: normal;">
                            <span>
                                <a href="" >mail:2308844@qq.com</a>
                                </span>
                        </div>
                    </div>
                    <div class="title" style="float: left;width: 200px;">
                        <div style="width: 200px;">
                            联系苏乐居
                        </div>
                        <div class="recommend-content" style="width:300px;margin-top: 0px;font-weight: normal;">
                            <span>
                                <a href="" >10106006</a>
                                <br>
                                <br>
                                <a href="">周一～周日 8:00～23:00</a>
                                </span>
                        </div>
                    </div><br>
                    <div id="max-buttom-info">
                        <div id="suleju-web-info">
                            <div style="width:300px;margin-left:-110px">
                                ©2015 上海万间信息技术有限公司
                            </div>  
                            <a href="" style="margin-right: 25px;">
                                隐私协议 
                            </a>
                            <a href="">服务协议</a>
                            <div style="width:300px;margin-left:30px;margin-right: 30px;">上海市浦东新区晨晖路88号 金蝶软件园</div>
                            <a href=""> 沪ICP备15004537号-2    </a>
                        </div>
                        <div id="suleju-web-info">
                            <div style="width: 25px;height: 23px;
                                margin-left: -130px;background-image: url(image/gongan.png);background-size: 100%;">
    
                            </div>
                            <a style="width:260px;margin-left:-100px">
                                沪公网安备31011502006937号  
                            </a>  
                            <div style="width:300px;margin-left:0px;">增值电信业务许可证：沪B2-20170251</div>
                            
                        </div>
                        
                    </div>
                    
                </div>
            </div>
        </div> 
    </div>
    


    <script> 

        let priceon = '';
        let imgs1=["","吴中","吴江","园区","太仓","姑苏","常熟","平江","张家港","高新区","沧浪","相城","昆山","金阊","1号线","2号线","4号线","4号线支线","3号线"];
        let regionOrSubway = null;
        let checkboxs = document.getElementsByName("like1[write]");
        let checkboxsValue = localStorage.getItem('rentalType');
        let selectOne = document.getElementById("select-one");
        selectOne.value = localStorage.getItem('value');
        let selectCheck = document.getElementById("select-check");
        let ifLift = document.getElementById("if-lift");
        let houseCharacteristic = document.getElementById("house-characteristic");
        
        $.ajax({
            type: "post",
            url : "http://localhost/gewu/houseInfor/hot",
            data: {
                
            },
            success: function(res){
                for(let i=1;i<5;i++){
                    let tbody2 = document.querySelector("#house-recommend");
                    let old2 = tbody2.innerHTML;
                    let str2 = 
                    `<a href=" javascript:void(0)" onclick = "click_house(${res.content[i].id})">
                        <div style="margin-left: 30px;">
                            <img src="../All-Image/house_pic/${res.content[i].housePicAddress[0]}" width="178px" height="177px" alt="">
                            <div class="comment-house">
                                <div style="height:5px"></div>
                                <span >${res.content[i].rentType}·${res.content[i].houseAddress}·${res.content[i].community}</span><br>
                                <div style="height:5px"></div>
                                <span style="color: #849aae;">${res.content[i].area}/</span>
                                <span style="color: #849aae;">${res.content[i].houseType} ${res.content[i].direction}</span>
                                <br>
                                <span style="color: red;background-color: white;font-size: 18px;margin-top: -7px;">${res.content[i].rentPrice}</span>
                                <span style="color: red;margin-top: -5px;background-color: white;font-size: 14px;">元/月</span>
                            </div>
                        </div>
                    </a>`
                    old2 += str2;
                    tbody2.innerHTML = old2;
                }
            }
        });

        $(function (){
            let pageTotal1=0;//总共的数据条数
            let pagecount=0;  //数据的总页数
            let pageNum=0;//第几页
            let pagesize=0;//每页的大小
            $.ajax({
                type:"post",
                url:"/gewu/searchHouseInfor/search",
                async:false,
                data:{
                        "selectValue": selectOne.value, // 前者为字段名，后者为数据
                        "regionOrSubway": regionOrSubway, // 前者为字段名，后者为数据
                        "checkboxsValue": checkboxsValue, // 前者为字段名，后者为数据
                    },
                success:function(res){
                    pageTotal=res.content.pageTotal; 
                    pageNum  = res.content.pageNum; 
                    pageSize = res.content.pageSize; 
                    pageCount = res.content.pageCount;         
                }
            })

            layui.use(['laypage', 'layer'], function(){//分页
                var laypage = layui.laypage,
                layer = layui.layer;
                laypage.render({
                    elem: 'layuipage',
                    count: pageTotal,
                    limit:  pageSize,
                    theme:'#1E9FFF',
                    layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
                    limits:[5,10,20,40],
                    jump: function(obj,first){
                        pageNum=obj.curr;  //改变当前页码
                        pagesize=obj.limit;
                        loadData();  //加载数据
                    }
                });
            });

            function loadData(){
                $.ajax({
                    type:"post",
                    url:"/gewu/searchHouseInfor/search",
                    data:{
                        "pageNum":pageNum,
                        "pagesize":pagesize,
                        "selectValue": selectOne.value, // 前者为字段名，后者为数据
                        "regionOrSubway": regionOrSubway, // 前者为字段名，后者为数据
                        "checkboxsValue": checkboxsValue, // 前者为字段名，后者为数据
                    },
                    success:function(res){
                        pageNum  = res.content.pageNum;    
                        let dataInfor= res.content.dataInforAll;
                        let housePics = res.content.housePics;
                        let housedatas = document.getElementById("housedatas");
                        let str ="";
                        for(let i=0;i<dataInfor.length;i++){          
                            let types = `<span>${dataInfor[i].elevator}</span> `;
                            for(let j = 0;j < dataInfor[i].type.length;j++){
                                types += `<span>${dataInfor[i].type[j]}</span> `
                            }
                            str +=
                            `<hr>
                            <a href=" javascript:void(0)" onclick = "click_house(${res.content.dataInforAll[i].id})">
                                <div class="house-info">
                                    <div style="float: left;">
                                        <img src="../All-Image/house_pic/${dataInfor[i].housePicAddress[0]}" width="178px" height="177px" alt="" >
                                    </div>
                                    <div class="house-info-right">
                                        <div  style="font-weight:bolder;font-size: 18px;color: black;width: 600px;">
                                            <span >${dataInfor[i].rentType}·${dataInfor[i].houseAddress}·${dataInfor[i].community} ${dataInfor[i].houseType} ${dataInfor[i].direction}</span>
                                            <span style="color: red;font-weight:bold;margin-top: 4px;background-color: white;font-size: 14px; float:right;">元/月</span>
                                            <span style="color: red;font-weight: bolder;background-color: white;font-size: 22px;margin-top: -7px; float: right;">${dataInfor[i].rentPrice}</span>
                                        </div>
                                        <div>
                                            苏州市-${dataInfor[i].area}-${dataInfor[i].houseAddress}·${dataInfor[i].community} / ${dataInfor[i].rentPrice}.00㎡ /${dataInfor[i].direction} / ${dataInfor[i].houseType}
                                        </div>
                                        <div>
                                            ${types}
                                        </div>
                                        <div>
                                            <span>全网最低价</span>
                                            <span>平台认证</span>
                                        </div>
                                    </div>
                                </div>
                            </a>
                            <hr>`
                        }
                        housedatas.innerHTML=str;
                    }
                })
            }
        })

        function selectTwo() {
            checkboxsValue = " ";
            for(let i1=0;i1<checkboxs.length;i1++) {
                if(checkboxs[i1].checked) {
                    checkboxsValue += `${checkboxs[i1].title} `;
                }
            }
            for(let i=0;i<checkboxs.length;i++) {
                if(checkboxs[i].checked) {
                    checkboxsValue += `${checkboxs[i].title} `;
                }
            }

            if(priceon != '') {
                checkboxsValue += priceon;
                document.getElementById("beforeone").value = null;
                document.getElementById("afterone").value = null;
                priceon = '';
            }

            let pageTotal1=0;//总共的数据条数
            let pagecount=0;  //数据的总页数
            let pageNum=0;//第几页
            let pagesize=0;//每页的大小
            $.ajax({
                type:"post",
                url:"/gewu/searchHouseInfor/search",
                async:false,
                data:{
                        "selectValue": selectOne.value, // 前者为字段名，后者为数据
                        "regionOrSubway": regionOrSubway, // 前者为字段名，后者为数据
                        "checkboxsValue": checkboxsValue, // 前者为字段名，后者为数据
                    },
                success:function(res){
                    pageTotal=res.content.pageTotal; 
                    pageNum  = res.content.pageNum; 
                    pageSize = res.content.pageSize; 
                    pageCount = res.content.pageCount;         
                }
            })

            layui.use(['laypage', 'layer'], function(){//分页
                var laypage = layui.laypage,
                layer = layui.layer;
                laypage.render({
                    elem: 'layuipage',
                    count: pageTotal,
                    limit:  pageSize,
                    theme:'#1E9FFF',
                    layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
                    jump: function(obj,first){
                        pageNum=obj.curr;  //改变当前页码
                        pagesize=obj.limit;
                        loadData();  //加载数据
                    }
                });
            });

            function loadData(){
                $.ajax({
                    type:"post",
                    url:"/gewu/searchHouseInfor/search",
                    data:{
                        "pageNum":pageNum,
                        "pageSize":pagesize,
                        "selectValue": selectOne.value, // 前者为字段名，后者为数据
                        "regionOrSubway": regionOrSubway, // 前者为字段名，后者为数据
                        "checkboxsValue": checkboxsValue, // 前者为字段名，后者为数据
                    },
                    success:function(res){
                        console.log(res);
                        pageNum  = res.content.pageNum;    
                        let dataInfor= res.content.dataInforAll;
                        let housePics = res.content.housePics;
                        let housedatas = document.getElementById("housedatas");
                        let str ="";
                        for(let i=0;i<dataInfor.length;i++){          
                            let types = `<span>${dataInfor[i].elevator}</span> `;
                            for(let j = 0;j < dataInfor[i].type.length;j++){
                                types += `<span>${dataInfor[i].type[j]}</span> `
                            }
                            str +=
                            `<hr>
                            <a href=" javascript:void(0)" onclick = "click_house(${res.content.dataInforAll[i].id})">
                                <div class="house-info">
                                    <div style="float: left;">
                                        <img src="../All-Image/house_pic/${dataInfor[i].housePicAddress[0]}" width="178px" height="177px" alt="" >
                                    </div>
                                    <div class="house-info-right">
                                        <div  style="font-weight:bolder;font-size: 18px;color: black;width: 600px;">
                                            <span >${dataInfor[i].rentType}·${dataInfor[i].houseAddress}·${dataInfor[i].community} ${dataInfor[i].houseType} ${dataInfor[i].direction}</span>
                                            <span style="color: red;font-weight:bold;margin-top: 4px;background-color: white;font-size: 14px; float:right;">元/月</span>
                                            <span style="color: red;font-weight: bolder;background-color: white;font-size: 22px;margin-top: -7px; float: right;">${dataInfor[i].rentPrice}</span>
                                        </div>
                                        <div>
                                            苏州市-${dataInfor[i].area}-${dataInfor[i].houseAddress}·${dataInfor[i].community} / ${dataInfor[i].rentPrice}.00㎡ /${dataInfor[i].direction} / ${dataInfor[i].houseType}
                                        </div>
                                        <div>
                                            ${types}
                                        </div>
                                        <div>
                                            <span>全网最低价</span>
                                            <span>平台认证</span>
                                        </div>
                                    </div>
                                </div>
                            </a>
                            <hr>`
                        }
                        housedatas.innerHTML=str;
                    }
                })
            }
        }

        function change1(n){
            //js改变属性
            regionOrSubway = imgs1[n];
            selectTwo();
        }

        for(let i = 0;i < 3;i++) {
            let hire = '?hire=' + i;
            //console.log(hire);
            if(hire == window.location.search) {
                selectCheck.checked = true;
            } else {
                if(selectCheck.title == localStorage.getItem('rentalType')) {
                    selectCheck.checked = true;
                    //console.log(selectCheck.title);
                }
            }
            selectTwo();
            selectCheck = selectCheck.nextElementSibling;
        }
    
        for(let i = 0;i < 2;i++) {
            if(ifLift.title == localStorage.getItem('value')) {   
                ifLift.checked = true;
                //console.log(selectCheck.title);
            }
            ifLift = ifLift.nextElementSibling;
        }
    
        for(let i = 0;i < 9;i++) {
            if(houseCharacteristic.title == localStorage.getItem('value')) {   
                houseCharacteristic.checked = true;
                //console.log(selectCheck.title);
            }
            houseCharacteristic = houseCharacteristic.nextElementSibling;
        }

        //发布房源判断是否登录，否则进入登录页面
        function release(){
            let token = localStorage.getItem("token");
            if(token != null){
                window.location = "upload-house.html";
            }
            else{
                layer.msg('请先登录！', {icon: 6,anim:0});   
                setTimeout(function(){window.location.href='logpage.html';},1000);
 
            }
        }
        //顶部登录注册用户名显示
        $(function(){
            let token = localStorage.getItem("token");
            if(token != null){
                $.ajax({
                    type:"get",
                    url:"/gewu/userLog/isLog",
                    headers:{"token":token},
                    success:function(res){   
                        if(res.code==200){
                            let username_pic = document.getElementById("username-pic");
                            let husername = document.getElementById("husername");
                            husername.innerText = res.content.username;
                            username_pic.style.display="block";
                        }
                        
                    }
                })
            }
            else{
                    let log_register = document.getElementById("log-register");
                    log_register.style.display="block"; 
                }
        })
        function top_exit(){   
            localStorage.removeItem("token");
            window.location.href = "frontpage.html"
        }    

        //余春海的，点击进入房子详情
        function click_house(id){
            $.ajax({
                type:"post",
                url:"/gewu/house/onclick",
                success:function(res){
                    window.location.href= "house-detail.html?house_id="+id;
                }
            });
        }

        function priceone(){
            priceon = document.getElementById("beforeone").value + '-' + document.getElementById("afterone").value;
            console.log(priceon);
        }
    </script>
</body>
</html>